{% extends './layout/default' %}

{% block breadcrumbs %}
    {{ Breadcrumbs.render(Route.getCurrentRoute.getName) }}
{% endblock %}

{% block content %}
    {% if count == 0 %}
        {% include 'partials.empty' with {objectType: 'default', type: 'tags',route: route('tags.create')} %}
    {% else %}
        <div class="row">
            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <p>
                    <a class="btn btn-success" href="{{ route('tags.create') }}"><span class="fa fa-plus fa-fw"></span> {{ ('no_tags_create_default')|_ }}</a>
                </p>
            </div>
        </div>
        <form action="{{ route('tags.mass-destroy') }}" method="post">
            <input type="hidden" name="_token" value="{{ csrf_token() }}"/>
            {% for period, entries in tags %}
                {% if entries|length > 0 %}
                    <div class="row">
                        <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                            <div class="box">
                                <div class="box-header with-border">
                                    <h3 class="box-title">
                                        {% if period == 'no-date' %}{{ 'without_date'|_ }}{% else %}{{ period }}{% endif %}
                                    </h3>
                                </div>
                                <div class="box-body">
                                    <div class="row">
                                        {% for tagInfo in entries %}
                                            <div class="col-xs-6 col-sm-4 col-md-3 col-lg-2"
                                                 style="line-height: 1.7em;"
                                            ><input type="checkbox" name="tags[]" value="{{ tagInfo.id }}"> <a
                                                    class="label label-success"
                                                    style="font-weight: normal;font-size:0.9em;"

                                                    title="{{ tagInfo.created_at.isoFormat(monthAndDayFormat) }}"
                                                    href="{{ route('tags.show',tagInfo.id) }}">{% if tagInfo.location %}<span class="fa fa-fw fa-map-marker"></span>{% endif %}<span class="fa fa-fw fa-tag"></span>{{ tagInfo.tag }}{% if tagInfo.attachments.count() > 0 %}<span class="fa fa-fw fa-paperclip"></span>{% endif %}</a></div>

                                        {% endfor %}
                                    </div>

                                    <ul class="list-inline">
                                        {% for tagInfo in entries %}
                                            <li>
                                                <!--&nbsp;-->

                                            </li>
                                        {% endfor %}
                                    </ul>

                                </div>
                            </div>
                        </div>
                    </div>
                {% endif %}
            {% endfor %}
            <div class="row">
                <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    <p>
                        <a class="btn btn-success" href="{{ route('tags.create') }}"><span class="fa fa-plus fa-fw"></span> {{ ('no_tags_create_default')|_ }}</a>
                        <button type="submit" class="btn pull-right btn-danger" onclick="return confirm('{{ 'are_you_sure'|_|escape('js') }}');">
                            <span class="fa fa-fw fa-trash"></span> {{ 'delete_all_selected_tags'|_ }}
                        </button>
                    </p>
                </div>
            </div>
        </form>
    {% endif %}

{% endblock %}
{% block scripts %}
    <script src="v1/js/ff/tags/index.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
{% endblock %}
